package com.tang.excel.pa.mapper;

import com.tang.excel.pa.domain.EmKnowledgeTestQuestion;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * @author Tang
 * @classname EmKnowledgeTestQuestionMapper
 * @description [  ]
 * @date 2021/4/20 11:06
 */
public interface EmKnowledgeTestQuestionMapper {

    int deleteByPrimaryKey(Integer id);

    int insert(EmKnowledgeTestQuestion record);

    int insertSelective(EmKnowledgeTestQuestion record);

    @Select(value = {
            "select * from em_knowledge_test_question",
            "where id = #{id,jdbcType=INTEGER}",
    })
    @ResultMap(value = {
            "EmKnowledgeTestQuestion"
    })
    EmKnowledgeTestQuestion selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(EmKnowledgeTestQuestion record);

    int updateByPrimaryKey(EmKnowledgeTestQuestion record);


    @Results(id = "EmKnowledgeTestQuestion", value = {
            @Result(id = true, column = "id", property = "id"),
            @Result(column = "topic", property = "topic"),
            @Result(column = "optionA", property = "optiona"),
            @Result(column = "optionB", property = "optionb"),
            @Result(column = "optionC", property = "optionc"),
            @Result(column = "optionD", property = "optiond"),
            @Result(column = "type", property = "type"),
            @Result(column = "test_type", property = "testType"),
            @Result(column = "correct_options", property = "correctOptions"),
            @Result(column = "create_time", property = "createTime"),
            @Result(column = "protocol", property = "protocol"),
    })
    @SelectProvider(type = EmKnowledgeTestQuestionSqlProvider.class, method = "sqlByCondition")
    public List<EmKnowledgeTestQuestion> selectByCondition(EmKnowledgeTestQuestion emKnowledgeTestQuestion);

}